local units = units

function GetPlayerBuffTimeLeft(index)
	local u = units.ResolveUnit("player")
	if not u then return 0 end
	local aura = u.auras and u.auras[index]
	return aura and aura.timeleft or 0
end

function GetPlayerBuff(index, filter)
	local u = units.ResolveUnit("player")
	if not u then return 0 end
	local id = units.GetBuffIndex(u, index, filter)
	return id or 0
end

function GetPlayerBuffName(index)
	local u = units.ResolveUnit("player")
	if not u then return 0 end
	local aura = u.auras and u.auras[index]
	return aura and (aura.name or "DEFAULT_BUFF_NAME")
end

function GetPlayerBuffTexture(index)
	local u = units.ResolveUnit("player")
	if not u then return 0 end
	local aura = u.auras and u.auras[index]
	return aura and (aura.texture or "DEFAULT_BUFF_TEXTURE")
end

function GetPlayerBuffDispelType(index)
	local u = units.ResolveUnit("player")
	if not u then return 0 end
	local aura = u.auras and u.auras[index]
	local type = aura and aura.dispeltype
	if type == "" then type = nil end
	return type
end

function GetPlayerBuffApplications()
	local u = units.ResolveUnit("player")
	if not u then return 0 end
	local aura = u.auras and u.auras[index]
	return aura and aura.applications or 0
end
